Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multicore http server #250

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

missinglink
Copy link
Member

@missinglink missinglink commented Mar 17, 2020

This draft PR is #249 plus a single commit to add multi-core support to the http server via the cluster module.

When using the node-postal 'module' adapter it is recommended to set the env var CPUS=1 to force the server single-threaded.

@missinglink
Copy link
Member Author

@orangejulius I did some basic testing on this and found that using multicore and libpostal service resulted in worse performance than running it single-threaded using the npm module.

Maybe there's an error in how I'm using the async code or something else going on?

@orangejulius
Copy link
Member

Yeah, I recall experiencing and reading about poor performance from the cluster2 module in the past.

After all, it's essentially a load balancing layer where different Node.js processes are communicating with each other. I imagine it's not nearly as efficient as say, Nginx in front of several identical Node.js processes reading from the same SQLite DB.

@missinglink missinglink force-pushed the better-sqlite3-v2-plus-libpostal-service-plus-multicore branch 2 times, most recently from afc85ab to d4678cf Compare March 20, 2020 15:09
@missinglink missinglink force-pushed the better-sqlite3-v2-plus-libpostal-service-plus-multicore branch from d4678cf to dadecb7 Compare March 20, 2020 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants